package com.acme.bankapp.domine.bank;

public class Client {
    private Gender gender;
    private String name;
    private Account[] accounts;
    private int maxCountAccount = 10;

    public int getCountAccount() {
        return countAccount;
    }

    private int countAccount;

    public Account[] getAccounts() {
        return accounts;
    }

    public Client(final String name, final Gender gender) {
        accounts = new Account[maxCountAccount];
        this.name = name;
        this.gender = gender;
    }

    // [MY] This is unused constructor. It should be removed.
    // [PE] Ok

    public String getClientSalutation() {
        return gender.toString() + " " + name;
    }

    public void addAccount(Account account) {
        if (countAccount < maxCountAccount) {
            accounts[countAccount++] = account;
        }
        else {
            System.out.println("Storage of accounts filled completely");
        }
    }
}
